package com.exde.wcsiapp.cookie;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class LoginStateSharedPreferences {

    private Context context;

    private SharedPreferences sharedPreferences;

    private Editor editor;

    public LoginStateSharedPreferences(){

    }

    public LoginStateSharedPreferences(Context context) {
        this.context = context;
    }

    public void sharedPreference(String key,String value){
        sharedPreferences = context.getSharedPreferences("login", Context.MODE_PRIVATE);
        editor = sharedPreferences.edit();
        editor.putString(key,value);
        editor.commit();
    }

    public void onDestroy(){
        sharedPreferences = context.getSharedPreferences("login", Context.MODE_PRIVATE);
        editor = sharedPreferences.edit();
        editor.clear();
        editor.commit();
    }
}
